package com.example.hbase.config;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

import java.io.IOException;

public class HBaseConfig {
    private static final String ZOOKEEPER_QUORUM = "192.40.10.130:2181";

    public static Connection getConnection() throws IOException {
        Configuration config = HBaseConfiguration.create();
        config.set("hbase.zookeeper.quorum", ZOOKEEPER_QUORUM);
        System.setProperty("HADOOP_USER_NAME", "root");
        System.out.println(config);
        return ConnectionFactory.createConnection(config);
    }
}